package org.chinacareer.position.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.alibaba.nacos.api.naming.NamingService;
import com.google.common.collect.Lists;

/**
 * @author jerry
 * @ClassName:  MyPollingServerListUpdater   
 * @Description:TODO(描述这个类的作用)   
 * @date 2022年12月1日 下午3:09:10
 */
@Component
public class ServerStatusRunner implements CommandLineRunner {

    @Autowired
    private NamingService namingService;
    @Value("${spring.cloud.nacos.discovery.group}")
    private String group;

    @Override
    public void run(String... args) throws Exception {
        namingService.subscribe("cts-message", group, Lists.newArrayList("DEFAULT"), new NacosListener());
    }
}
